var Ajax;
if (Ajax && (Ajax != null)) {
    Ajax.Responders.register({
        onCreate: function() {
            if ($('spinner') && Ajax.activeRequestCount > 0)
                Effect.Appear('spinner', {duration:0,queue:'end'});
        },
        onComplete: function() {
            if ($('spinner') && Ajax.activeRequestCount == 0)
                Effect.Fade('spinner', {duration:0,queue:'end'});
        }
    });
}

var Booking = {
    remoteValidate : function (model, field, value, update) {
        jq.get('_ajaxvalidate', {model:model,field:field,value:value}, function(data) {
            jq("#" + update).html(data);
            if (data != '')
                jq("#" + update).parent().addClass('errors');
            else
                jq("#" + update).parent().removeClass('errors');
        });
    }
}